<admintpl file="header"/>
<body class="J_scroll_fixed">
<div class="wrap J_check_wrap">
   <ul class="nav nav-tabs">
     <li class="active"><a href="{:U('user/index')}">管理员</a></li>
     <li><a href="{:U('user/add')}">添加管理员</a></li>
  </ul>
   <div class="table_list">
   <table width="100%" cellspacing="0" class="table table-hover">
        <thead>
          <tr>
            <th width="50">ID</th>
            <th>用户名</th>
            <th>最后登录IP</th>
            <th>最后登录时间</th>
            <th>E-mail</th>
            <th>状态</th>
            <th width="120">管理操作</th>
          </tr>
        </thead>
        <tbody>
        <php>$user_statuses=array("0"=>"停用","1"=>"启用","2"=>"未验证");</php>
        <foreach name="users" item="vo">
          <tr>
            <td>{$vo.id}</td>
            <td>{$vo.user_login}</td>
            <td>{$vo.last_login_ip}</td>
            <td>
	            <if condition="$vo['last_login_time'] eq 0">
	            该用户还没登陆过
	            <else />
	            {$vo.last_login_time}
	            </if>
            </td>
            <td>{$vo.user_email}</td>
            <td>{$user_statuses[$vo['user_status']]}</td>
            <td>
	            <if condition="$vo['id'] eq 1">
	            <font color="#cccccc">修改</font> | 
	            <font color="#cccccc">删除</font>
	            <if condition="$vo['user_status'] eq 1">
                    <font color="#cccccc">停用</font>
                	<else />
                    <font color="#cccccc">启用</font>
                    </if>
	            <else />
	            <a href='{:U("user/edit",array("id"=>$vo["id"]))}'>修改</a> | 
	            <a class="J_ajax_del" href="{:U('user/delete',array('id'=>$vo['id']))}">删除</a> | 
                    <if condition="$vo['user_status'] eq 1">
                    <a href="{:U('user/ban',array('id'=>$vo['id']))}" class="J_ajax_dialog_btn" data-msg="您确定要停用此用户吗？">停用</a>
	            	<else />
                    <a href="{:U('user/cancelban',array('id'=>$vo['id']))}" class="J_ajax_dialog_btn" data-msg="您确定要启用此用户吗？">启用</a>
                    </if>
	            </if>
            </td>
          </tr>
         </foreach>
        </tbody>
      </table>
      <div class="pagination">{$page}</div>
   </div>
</div>
<script src="__ROOT__/statics/js/common.js"></script>
</body>
</html>